@use "sass:math";

@mixin fontMono {
  font-family: "DM Mono", monospace;
}

@mixin headline1 {
  font-weight: 600;
  font-size: 40px;
  line-height: 48px;
}
@mixin pageTitle {
  font-weight: normal;
  font-size: 24px;
  line-height: 36px;
  color: var(--gray-base);
  margin: 0;
}

@mixin sectionTitle {
  font-weight: normal;
  font-size: 17px;
  color: var(--gray-base);
  margin-top: 0;
  margin-bottom: var(--default-spacing);
}

@mixin title1 {
  font-size: 15px;
  font-style: normal;
  font-weight: normal;
  line-height: 18px;
  color: var(--gray-base);
}

@mixin headline-description {
  font-weight: 500;
  font-size: 10px;
  line-height: 120%;
  color: var(--gray-40);
  margin-bottom: var(--default-spacing);
}

@mixin body1 {
  font-size: 15px;
  font-style: normal;
  font-weight: normal;
  line-height: 18px;
  color: var(--gray-20);
}

@mixin body2 {
  font-size: 12px;
  font-style: normal;
  font-weight: normal;
  line-height: 20px;
  color: var(--gray-20);
}

@mixin body3 {
  font-size: 12px;
  line-height: 18px;
  font-style: normal;
  font-weight: normal;
  color: var(--gray-20);
}

@mixin body4 {
  font-size: 14px;
  line-height: 22px;
  font-style: normal;
  font-weight: 500;
}

@mixin errorMessage {
  color: var(--color-negative);
  font-size: 10px;
}

@mixin bold {
  font-weight: 600;
}

@mixin semiBold {
  font-weight: 500;
}

@mixin textField {
  font: inherit;
  font-size: var(--tag-font-size);
  padding: calc(var(--default-spacing) / 2) var(--default-spacing);
  background-color: var(--gray-full);
  border: $border-dark;
  border-radius: var(--form-elements-border-radius);
  width: 100%;
  box-sizing: border-box;
  color: var(--gray-20);
  height: var(--field-height);
}

@mixin label {
  display: block;
  font-size: var(--text-field-label-font-size);
  margin-bottom: var(--default-spacing-small);
  color: var(--gray-30);
}

@mixin textField--active {
  outline: none;
  box-shadow: none;
  border: $border-primary;
  transition: border 0.2s ease-in, color 0.2s ease-in;
  color: var(--gray-base);
}

@mixin textField--disabled {
  background: var(--gray-80);
  border: var(--gray-70);
}

$bullet-size: 6px;

@mixin flexFullRow {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

@mixin flexVerticalCenter {
  display: flex;
  align-items: center;
}

@mixin flexFullRowWithSpacing {
  @include flexFullRow();
  .spacer {
    flex: 1;
  }
  > * {
    margin-left: var(--default-spacing);
    &:first-child {
      margin-left: 0;
    }
  }
}

//Merge two mixins
@mixin flexFullRowWithSpacingBothSides {
  @include flexFullRow();
  .spacer {
    flex: 1;
  }
  > * {
    margin-left: var(--default-spacing);
    &:first-child {
      margin-left: 0;
    }

    margin-right: var(--default-spacing);
    &:last-child {
      margin-right: 0;
    }
  }
}

@mixin scrollbars(
  $size,
  $foreground-color,
  $background-color: mix($foreground-color, white, 50%)
) {
  // For Google Chrome
  &::-webkit-scrollbar {
    width: $size;
    height: $size;
  }

  &::-webkit-scrollbar-thumb {
    background: $foreground-color;
    border-radius: $size * 0.5;
  }

  &::-webkit-scrollbar-track {
    background: $background-color;
    border-radius: $size * 0.5;
    margin: 10px;
  }

  // For Internet Explorer
  & {
    scrollbar-face-color: $foreground-color;
    scrollbar-track-color: $background-color;
  }
}

@mixin modalForm {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--default-spacing);

  > * {
    margin-bottom: var(--large-spacing);
    &:last-child {
      margin-bottom: 0;
    }
  }

  &__instructions {
    @include body2;
    color: var(--gray-base);
    margin-bottom: var(--double-spacing);
    text-align: center;
    font-size: var(--title5-font-size);
  }

  .text-input {
    margin-bottom: var(--large-spacing);

    input {
      max-width: none;
    }

    label {
      margin: 0;
    }

    &.text-input--has-error {
      .amplication-label__error {
        margin: var(--default-spacing);
      }
    }
  }

  form {
    width: 100%;
  }

  .amp-button {
    margin-bottom: 0;
    width: 100%;
  }
}

@mixin counterBadge {
  font-weight: 500;
  font-size: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: absolute;
  top: -8px;
  left: calc(100% - 14px);
  height: 16px;
  min-width: 16px;
  background-color: var(--primary);
  color: var(--gray-full);
  border-radius: 8px;
  padding-left: 4px;
  padding-right: 4px;
}

@mixin font-base {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Roboto",
    "Helvetica Neue", sans-serif;
  -moz-osx-font-smoothing: grayscale;
}

@mixin title-24 {
  @include font-base();
  font-weight: 600;
  font-size: 24px;
  line-height: 36px;
  color: #f5f6fa;
}

@mixin title-18 {
  @include font-base();
  font-weight: 600;
  font-size: 18px;
  line-height: 27px;
  color: #f5f6fa;
}

@mixin title-14 {
  @include font-base();
  font-weight: 600;
  font-size: 14px;
  line-height: 27px;
  color: #f5f6fa;
}

@mixin bold-14 {
  @include font-base();
  font-weight: 600;
  font-size: 14px;
  line-height: 22px;
  color: #f5f6fa;
}

@mixin regular-14 {
  @include font-base();
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  color: #f5f6fa;
}

@mixin bold-12 {
  @include font-base();
  font-weight: 600;
  font-size: 12px;
  line-height: 18px;
  color: #f5f6fa;
}

@mixin regular-12 {
  @include font-base();
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
  color: #f5f6fa;
}

@mixin regular-10 {
  @include font-base();
  font-weight: 400;
  font-size: 10px;
  line-height: 15px;
  color: #f5f6fa;
}

@mixin regular-8 {
  @include font-base();
  font-weight: 400;
  font-size: 8px;
  line-height: 12px;
  color: #f5f6fa;
}
